﻿<?php include $this->admin_tpl('meta');?>
</head>
<body>
<article class="page-container">
<div class="formdoby_normal"> 
	<form method="post" onsubmit="return dosub(this)">
	<div class="tabCon formdoby_info" style="display: block;">
		<div class="yzm-table-box">
		<table width="100%" class="table table-border yzmcms_table">
			<tbody>
			<tr>
				<td width="120"><span class="c-red">*</span>字段标题：</td> 
				<td>
				<input type="text" name="title" autocomplete="off" value="<?php echo $data['title']??'';?>" class="input-text" placeholder="请输入字段标题">
				</td>
			</tr>
			<tr>
				<td width="120"><span class="c-red">*</span>字段名称：</td> 
				<td>
				<input type="text" name="field" autocomplete="off" value="<?php echo $field??'';?>"  <?php if($field){echo 'readonly style="background:#eee;"';}?> class="input-text" placeholder="请输入字段名称">
				</td>
			</tr>
			<tr>
				<td width="120"><span class="c-red">*</span>字段排序：</td> 
				<td>
				<input type="text" name="id" autocomplete="off" value="<?php echo $data['id']??'';?>" class="input-text" placeholder="请输入字段排序">
				</td>
			</tr>
			<tr>
				<td width="120"><span class="c-red">*</span>显示宽度：</td> 
				<td>
				<input type="text" name="width" autocomplete="off" value="<?php echo $data['width']??'';?>" class="input-text" placeholder="请输入显示宽度">
				</td>
			</tr>
			<tr>
				<td width="120"><span class="c-red">*</span>是否搜索：</td> 
				<td>
					<span class="span_input">
						<label class="label_radio"><input name="search" type="radio" value="1" <?php if(isset($data['search'])&&$data['search']==1){?>checked="1"<?php } ?>> 是</label>
						<label class="label_radio"><input name="search" type="radio" value="0" <?php if(isset($data['search'])&&$data['search']==0){?>checked="1"<?php } ?>> 否</label>
					</span>
				</td>
			</tr>
			<tr>
				<td width="120"><span class="c-red">*</span>是否排序：</td> 
				<td>
					<span class="span_input">
						<label class="label_radio"><input name="sort" type="radio" value="1" <?php if(isset($data['sort'])&&$data['sort']==1){?>checked="1"<?php } ?>> 是</label>
						<label class="label_radio"><input name="sort" type="radio" value="0" <?php if(isset($data['sort'])&&$data['sort']==0){?>checked="1"<?php } ?>> 否</label>
					</span>
				</td>
			</tr>
			<tr>
				<td width="120"><span class="c-red">*</span>对齐方式：</td> 
				<td>
					<span class="span_input">
						<label class="label_radio"><input name="align" type="radio" value="left" <?php if(isset($data['align'])&&$data['align']=='left'){?>checked="1"<?php } ?>> 左对齐</label>
						<label class="label_radio"><input name="align" type="radio" value="center" <?php if(isset($data['align'])&&$data['align']=='center'){?>checked="1"<?php } ?>> 居中</label>
					</span>
				</td>
			</tr>
			<tr>
				<td width="120"><span class="c-red">*</span>是否求和：</td> 
				<td>
					<span class="span_input">
						<label class="label_radio"><input name="totalRow" type="radio" value="1" <?php if(isset($data['totalRow'])&&$data['totalRow']==1){?>checked="1"<?php } ?>> 是</label>
						<label class="label_radio"><input name="totalRow" type="radio" value="0" <?php if(isset($data['totalRow'])&&$data['totalRow']==0){?>checked="1"<?php } ?>> 否</label>
					</span>
				</td>
			</tr>
			<tr>
				<td width="120"><span class="c-red">*</span>是否可编辑：</td> 
				<td>
					<span class="span_input">
						<label class="label_radio"><input name="edit" type="radio" value="1" <?php if(isset($data['edit'])&&$data['edit']==1){?>checked="1"<?php } ?>> 是</label>
						<label class="label_radio"><input name="edit" type="radio" value="0" <?php if(isset($data['edit'])&&$data['edit']==0){?>checked="1"<?php } ?>> 否</label>
					</span>
				</td>
			</tr>
			<tr>
				<td width="120"><span class="c-red">*</span>是否开关：</td> 
				<td>
					<span class="span_input">
						<label class="label_radio"><input name="is_switch" type="radio" value="1" <?php if(isset($data['is_switch'])&&$data['is_switch']==1){?>checked="1"<?php } ?>> 是</label>
						<label class="label_radio"><input name="is_switch" type="radio" value="0" <?php if(isset($data['is_switch'])&&$data['is_switch']==0){?>checked="1"<?php } ?>> 否</label>
					</span>
				</td>
			</tr>
			</tbody>
		</table>
		</div>
	
	</div>
	<div class="footer_btn">
		<input type="hidden" name="dosubmit" value="1">
		<input class="btn btn-primary radius" type="submit" value="提 交">
		<input class="btn btn-default radius" type="button" value="取 消" onclick="yzmcms_close()">	
	</div>
	</form>
</div>
</article>
<?php include $this->admin_tpl('footer');?>
<script type="text/javascript" src="<?php echo STATIC_URL;?>plugin/layui/layui.js"></script>
<script type="text/javascript">
function dosub(obj){
	$.ajax({
		type: 'POST',
		url: '<?php echo U('diy_field',['id'=>$id,'field'=>$field,'action'=>'edit']);?>', 
		data: $(obj).serialize(),
		dataType: "json", 
		success: function (msg) {
			if(msg.status == 1){
				layer.msg(msg.message, {icon:1, time:800}, function(){
					parent.location.reload();
				});
			}else{
				layer.msg(msg.message, {icon:2});
			}
		}
	})		 
	return false;			 
}
</script> 

</body>
</html>